package org.example.cloud.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.cloud.service.StorageService;
import org.example.cloud.util.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 宋孟林
 * @description
 * @date: 2025/4/12 9:29
 */
@Slf4j
@RestController
public class StorageController {
    @Resource
    private StorageService storageService;

    @PostMapping("/storage/decrease")
    public ResultData<?> decrease(Long productId, Integer count){
        storageService.decrease(productId, count);
        return ResultData.success("扣减库存成功");
    }
}
